package com.econ.springboot.clickhouse.demo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.econ.springboot.clickhouse.demo.domain.Weather;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

public interface WeatherMapper extends BaseMapper<Weather> {

    @Insert("<script>insert into weather VALUES <foreach collection='list' item='weather' separator=','>(#{weather.ts}, #{weather.temperature}, #{weather.humidity}, #{weather.location}, #{weather.groupId})</foreach></script>")
    int insertBatch(List<Weather> list);
}
